package com.logic.modular.gameCore.map;

import com.logic.comment.util.Graph;
import com.comment.pojo.domain.logic.core.CoreCityLink;

import java.util.List;

public class CityGraph {
    public static Graph initGraph(List<CoreCityLink> cityLink) {
        Graph graph = new Graph();// 路线查询器
        cityLink.forEach(mapCellLink -> {
            Integer mapCellId = mapCellLink.getStartCityId();
            Integer targetId = mapCellLink.getTargetCityId();
            graph.oneWayAddEdge(mapCellId, targetId);//单项 可以使用双向towayAddEdge
        });
        return graph;
    }

}
